﻿<%@ Page Language="C#" MasterPageFile="~/Admin/AdminPage.Master" AutoEventWireup="true"
    CodeBehind="AdminStdFeedback.aspx.cs" Inherits="HiTeachers.Web.AdminStdFeedback"
    Title="HiTeachers - Phản hồi từ học viên" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <div class="admcontent">
        <table width="100%">
            <tr>
                <td colspan="2" class="admToolbar">
                    <asp:Button ID="btnShowUnShow" Text="Hiển thị/Không hiển thị" CssClass="btnClass"
                        ToolTip="Hiển thị/Không hiển thị những phản hồi đã đánh dấu!" OnClick="BtnShowUnShowClick"
                        runat="server" />&nbsp;
                    <asp:Button ID="btnDelete" Text="Chọn xóa" CssClass="btnClass" ToolTip="Xóa những tin đã đánh dấu!"
                        OnClick="BtnDeleteClick" runat="server" />
                </td>
            </tr>
            <tr>
                <td align="left" valign="bottom">
                    <label class="lblIntrText">
                        Danh sách phản hồi từ học viên</label>
                </td>
                <td align="right" style="padding-top: 5px;">
                    Trạng thái phản hồi:&nbsp;<asp:DropDownList ID="ddlFeedbackReview" AutoPostBack="true"
                        runat="server">
                        <asp:ListItem Value="2" Text="Tất cả"></asp:ListItem>
                        <asp:ListItem Value="0" Text="Chưa kiểm tra"></asp:ListItem>
                        <asp:ListItem Value="1" Text="Đã kiểm tra"></asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
        <asp:UpdatePanel ID="udpGrid" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <asp:ObjectDataSource ID="objStdFeedback" TypeName="HiTeachers.Services.StudentFeedbackServices"
                    SelectMethod="GetFeedbacks" EnablePaging="True" SelectCountMethod="TotalNumberOfFeedback"
                    runat="server">
                    <SelectParameters>
                        <asp:ControlParameter Name="reviewStatus" ControlID="ddlFeedbackReview" Direction="Input"
                            Type="Int32" DefaultValue="2" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:GridView ID="gridData" DataSourceID="objStdFeedback" DataKeyNames="ID" AutoGenerateColumns="False"
                    CellPadding="3" CellSpacing="0" Width="100%" BorderColor="#A4A9B2" BorderWidth="1"
                    CssClass="GrdData" AllowPaging="True" ShowFooter="False" PageSize="20" runat="server">
                    <RowStyle BackColor="#EFF3FB" />
                    <AlternatingRowStyle BackColor="#DAE0EC" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#9399A5" Font-Bold="True" ForeColor="#F2F4F7" Height="25px"
                        HorizontalAlign="Center" />
                    <PagerStyle ForeColor="Black" HorizontalAlign="Right" BackColor="#C6C3C6" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <input type="Checkbox" id="ChkAll" name="ChkAll" runat="server" onclick="javascript:CheckAll(this.checked);"
                                    title="Chọn tất cả để Hiển thị/Không hiển thị/Chọn xóa" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="chkSelect" onclick="javascript:ItCheck(this.checked);" name="chkItem"
                                    type="checkbox" value='<%# Eval("Id") %>' title="Chọn để Hiển thị/Không hiển thị/Chọn xóa" />
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <input id="chkSelect" onclick="javascript:ItCheck(this.checked);" name="chkItem"
                                    type="checkbox" value='<%# Eval("Id") %>' title="Chọn để Hiển thị/Không hiển thị/Chọn xóa" />
                            </AlternatingItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="45px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Thông tin giáo viên</HeaderTemplate>
                            <ItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td style="width: 65px;" valign="top" rowspan="2">
                                            <hiteacher:ResizedImage ID="imgFace" ImageUrl='<%# Eval("Teacher.ImagePath") %>'
                                                MaxHeight="60" MaxWidth="60" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Image ID="imgActivate" runat="server" ToolTip='<%# (Convert.ToBoolean(Eval("Teacher.IsVerified")))?"Thành viên đã kích hoạt tài khoản!":"Thành viên chưa kích hoạt tài khoản!" %>'
                                                ImageUrl='<%# Eval("Teacher.IsVerified", "/images/techVerified_{0}.png") %>'
                                                Style="cursor: hand; float: left; margin-right: 3px; margin-top: -4px;" />
                                            <asp:Label ID="lblIntrText" CssClass="lblIntrText" Text='<%# Eval("Teacher.Name") %>'
                                                runat="server"></asp:Label>
                                            <ajaxToolkit:Rating ID="teacherRating" CssClass="divRating" CurrentRating='<%# Eval("Teacher.Rate") %>'
                                                MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar"
                                                FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" Direction="LeftToRight"
                                                RatingDirection="LeftToRightTopToBottom" runat="server">
                                            </ajaxToolkit:Rating>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:Label ID="lblPhone" runat="server" Text='<%# string.Format("+ Số điện thoại: {0}",Eval("Teacher.PhoneNumber")) %>' /><br />
                                            <asp:Label ID="lblEmailPhone" runat="server" Text='<%# string.Format("+ Email: {0}", Eval("Teacher.Email")) %>' /><br />
                                            <asp:Label ID="lblAddress" runat="server" Text='<%# string.Format("+ Địa chỉ: {0}, {1}, {2}", Eval("Teacher.Address"),Eval("Teacher.District"),Eval("Teacher.City")) %>' />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td style="width: 65px;" valign="top" rowspan="2">
                                            <hiteacher:ResizedImage ID="imgFace" ImageUrl='<%# Eval("Teacher.ImagePath") %>'
                                                MaxHeight="60" MaxWidth="60" runat="server" />
                                        </td>
                                        <td>
                                            <asp:Image ID="imgActivate" runat="server" ToolTip='<%# (Convert.ToBoolean(Eval("Teacher.IsVerified")))?"Thành viên đã kích hoạt tài khoản!":"Thành viên chưa kích hoạt tài khoản!" %>'
                                                ImageUrl='<%# Eval("Teacher.IsVerified", "/images/techVerified_{0}.png") %>'
                                                Style="cursor: hand; float: left; margin-right: 3px; margin-top: -4px;" />
                                            <asp:Label ID="lblIntrText" CssClass="lblIntrText" Text='<%# Eval("Teacher.Name") %>'
                                                runat="server"></asp:Label>
                                            <ajaxToolkit:Rating ID="teacherRating" CssClass="divRating" CurrentRating='<%# Eval("Teacher.Rate") %>'
                                                MaxRating="5" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar"
                                                FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" Direction="LeftToRight"
                                                RatingDirection="LeftToRightTopToBottom" runat="server">
                                            </ajaxToolkit:Rating>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <asp:Label ID="lblPhone" runat="server" Text='<%# string.Format("+ Số điện thoại: {0}",Eval("Teacher.PhoneNumber")) %>' /><br />
                                            <asp:Label ID="lblEmailPhone" runat="server" Text='<%# string.Format("+ Email: {0}", Eval("Teacher.Email")) %>' /><br />
                                            <asp:Label ID="lblAddress" runat="server" Text='<%# string.Format("+ Địa chỉ: {0}, {1}, {2}", Eval("Teacher.Address"),Eval("Teacher.District"),Eval("Teacher.City")) %>' />
                                        </td>
                                    </tr>
                                </table>
                            </AlternatingItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Top">
                            <HeaderTemplate>
                                &nbsp;Thông tin học viên</HeaderTemplate>
                            <ItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblName" CssClass="lblIntrText" Text='<%# Eval("Name") %>' runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblPhoneEmail" runat="server" Text='<%# string.Format("+ Email: {0}", Eval("Email")) %>' /><br />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblName" CssClass="lblIntrText" Text='<%# Eval("Name") %>' runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblPhoneEmail" runat="server" Text='<%# string.Format("+ Email: {0}", Eval("Email")) %>' /><br />
                                        </td>
                                    </tr>
                                </table>
                            </AlternatingItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Top">
                            <HeaderTemplate>
                                &nbsp;Nội dung phản hồi</HeaderTemplate>
                            <ItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td class="TitleInfo">
                                            Đánh giá:
                                            <hiteacher:LiteralStar ID="ltrRating" NumberStar='<%# Eval("Rate") %>' runat="server"></hiteacher:LiteralStar>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="LblNewsIntro" runat="server" Text='<%# Eval("Content") %>' />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <table width="100%" class="infoTb" cellpadding="3" cellspacing="3">
                                    <tr>
                                        <td class="TitleInfo">
                                            Đánh giá:
                                            <hiteacher:LiteralStar ID="ltrRating" NumberStar='<%# Eval("Rate") %>' runat="server"></hiteacher:LiteralStar>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="LblNewsIntro" runat="server" Text='<%# Eval("Content") %>' />
                                        </td>
                                    </tr>
                                </table>
                            </AlternatingItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <%--<asp:TemplateField>
                            <HeaderTemplate>
                                Kiểm tra</HeaderTemplate>
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="HShowItem" CommandName='<%# (Convert.ToBoolean(Eval("IsReviewed"))) ? "UnShow" : "Show" %>'
                                    CommandArgument='<%# Eval("Id") %>' OnCommand="GridDataItemCommand"><img src='<%# Eval("IsReviewed", "/images/show_{0}.gif") %>' alt="" 
                            title='<%# (Convert.ToBoolean(Eval("IsReviewed")))?"Chuyển sang trạng thái chưa kiểm tra!":"Chuyển sang trạng thái đã kiểm tra!" %>' border="0" />
                                </asp:LinkButton>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <asp:LinkButton runat="server" ID="HShowItem" CommandName='<%# (Convert.ToBoolean(Eval("IsReviewed"))) ? "UnShow" : "Show" %>'
                                    CommandArgument='<%# Eval("Id") %>' OnCommand="GridDataItemCommand"><img src='<%# Eval("IsReviewed", "/images/show_{0}.gif") %>' alt="" 
                            title='<%# (Convert.ToBoolean(Eval("IsReviewed")))?"Chuyển sang trạng thái chưa kiểm tra!":"Chuyển sang trạng thái đã kiểm tra!" %>' border="0" />
                                </asp:LinkButton>
                            </AlternatingItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="65px" />
                        </asp:TemplateField>--%>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Thao tác</HeaderTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="IMGDelItem" runat="server" ToolTip="Xoá phản hồi này!" ImageUrl="/images/del.gif"
                                    CommandName="Delete" CommandArgument='<%# Eval("ID") %>' OnClientClick="return ConfirmDel();"
                                    Style="cursor: hand" OnCommand="GridDataItemCommand" />
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <asp:ImageButton ID="IMGDelItem" runat="server" ToolTip="Xoá phản hồi này!" ImageUrl="/images/del.gif"
                                    CommandName="Delete" CommandArgument='<%# Eval("ID") %>' OnClientClick="return ConfirmDel();"
                                    Style="cursor: hand" OnCommand="GridDataItemCommand" />
                            </AlternatingItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="65px" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ddlFeedbackReview" />
                <asp:AsyncPostBackTrigger ControlID="btnShowUnShow" />
                <asp:AsyncPostBackTrigger ControlID="btnDelete" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
